package com.jm.common.util;

import com.jm.common.enums.MobileOperatorEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author:JianWu
 * @Date: 2025/1/13  17:48
 */
public class OperatorUtil {

    private static Map<String,Integer> operates = new HashMap<>();

    static {
        MobileOperatorEnum[] operatorEnums = MobileOperatorEnum.values();
        for (MobileOperatorEnum operatorEnum : operatorEnums) {
            operates.put(operatorEnum.getOperatorName(),operatorEnum.getOperatorId());
        }
    }

    public static Integer getOperatorIdByOperatorName(String operatorName){
        return operates.get(operatorName);
    }
}
